package org.springd3.d2.dao.impl;


import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.springd3.d2.dao.NewsTypeMapper;
import org.springd3.d2.pojo.NewsType;

import java.util.List;

public class NewsTypeMapperImpl implements NewsTypeMapper{
    SqlSessionFactory factory;

    private SqlSessionTemplate sqlSession;

    public SqlSessionFactory getFactory() {
        return factory;
    }

    public void setFactory(SqlSessionFactory factory) {
        this.factory = factory;
    }

    public SqlSessionTemplate getSqlSession() {
        return sqlSession;
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }
    //  SqlSessionTemplate实现了SqlSession接口

    @Override
    public List<NewsType> getAllNewsType() {
        return sqlSession.getMapper(NewsTypeMapper.class).getAllNewsType();
    }
}
